package com.svse.designPattern.structure.composite.left;

import com.svse.designPattern.structure.composite.component.Component;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/8/2 9:42
 */
public class Leaf implements Component {
    private String name;
    public Leaf(String name){
        this.name=name;
    }
    @Override
    public void add(Component c) {

    }

    @Override
    public void remove(Component c) {

    }

    @Override
    public Component getChild(int i) {
        return null;
    }

    @Override
    public void operation() {
        System.out.println("树叶"+name+"：被访问！");
    }
}
